;--------------------------------------
;
; prog4-13.asm
;
; Demonstration of 
;   Integer TO Hex (itoh) code 
;   conversion
;

;--------------------------------------
;
; include all defines, macros, 
; prototypes and set up memory model
;

include tab6.inc


;--------------------------------------
;
; Create stack
;

	.STACK                         ; 1 k by default

;--------------------------------------
;
; Declare data segment
;

	.DATA


num8    db      0f1h
num16   dw      9fach


buffer  db      8 DUP(0)
num_b   db      'HEX bytes in buffer.',0
col     db      ?

counter dw      0

;--------------------------------------
;
; Begin code segment
;

	.CODE


;--------------------------------------
;
; Start program here
;

	.STARTUP


; clear the screen

        INVOKE clrScrn,7

        INVOKE  itoh,ADDR buffer,num8,HEX_8_BIT
        INVOKE  bdwrite,0,0,ADDR buffer
        INVOKE  strlen,ADDR buffer
        mov     col,al
        inc     col
        INVOKE  bdwrite,0,col,ADDR num_b
        

        INVOKE  itoh,ADDR buffer,num16,HEX_16_BIT
        INVOKE  bdwrite,1,0,ADDR buffer
        INVOKE  strlen,ADDR buffer
        mov     col,al
        inc     col
        INVOKE  bdwrite,1,col,ADDR num_b


; move the cursor to 2,0

        INVOKE  mvCur,2,0



;
	.EXIT

;--------------------------------------
;
; End of ASSEMBLY source file
;

	END


;
;--------------------------------------
